package com.itheima.day13.thread.test17;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodie extends Thread {
    private ArrayBlockingQueue<String> abq;
    public Foodie(ArrayBlockingQueue<String> abq) {
        this.abq = abq;
    }

    @Override
    public void run() {
        while(true){
            try {
                String take = abq.take();
                System.out.println("顾客拿了一个"+take+"\n");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
